package com.example.myhuangye.SH;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

import com.example.myhuangye.R;

public class MainSH0ctivity extends AppCompatActivity implements View.OnClickListener{
    private Button SH6,SH7,SH8;
    private ImageButton SHcall6,SHcall7,SHcall8;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_sh0ctivity);
        SH6= (Button) findViewById(R.id.SH6);
        SH6.setOnClickListener(this);
        SHcall6= (ImageButton) findViewById(R.id.SHcall6);
        SHcall6.setOnClickListener(this);

        SH7= (Button) findViewById(R.id.SH7);
        SH7.setOnClickListener(this);
        SHcall7= (ImageButton) findViewById(R.id.SHcall7);
        SHcall7.setOnClickListener(this);

        SH8= (Button) findViewById(R.id.SH8);
        SH8.setOnClickListener(this);
        SHcall8= (ImageButton) findViewById(R.id.SHcall8);
        SHcall8.setOnClickListener(this);
        findViewById(R.id.HT30).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

    }//回退//

    public void onClick(View view) {//点击事件//
        switch (view.getId()){
            case R.id.SH6:
                Uri uri = Uri.parse("http://www.fedex.com");
                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                startActivity(intent);

                break;
            case R.id.SHcall6:
                Intent intent1=  new Intent(Intent.ACTION_DIAL);
                intent1.setData(Uri.parse("tel:400-188-8888"));
                startActivity(intent1);
                break;

            case R.id.SH7:
                Uri uri1 = Uri.parse("http://www.cgbchina.com.cn");
                Intent intent2 = new Intent(Intent.ACTION_VIEW, uri1);
                startActivity(intent2);

                break;
            case R.id.SHcall7:
                Intent intent3=  new Intent(Intent.ACTION_DIAL);
                intent3.setData(Uri.parse("tel:95508"));
                startActivity(intent3);
                break;

            case R.id.SH8:
                Uri uri2 = Uri.parse("http://www.sldex.com");
                Intent intent4 = new Intent(Intent.ACTION_VIEW, uri2);
                startActivity(intent4);

                break;
            case R.id.SHcall8:
                Intent intent5=  new Intent(Intent.ACTION_DIAL);
                intent5.setData(Uri.parse("tel:412-8568"));
                startActivity(intent5);
                break;




        }


    }



}




